package biz.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import dao.UsersDao;
import entity.Folder;
import entity.Users;
import biz.UsersBiz;

public class UsersBizImpl implements UsersBiz {
	private UsersDao usersDao;

	public Integer count(){
		return usersDao.count();
	}
	public Integer count(Map map) {
		return usersDao.count2(map);
	}
	public List<Users> findAll(){
		return usersDao.findAll();
	}
	public List<Users> findByPage(Integer pageNo, Integer rows){
		Map map = new HashMap();
		map.put("start", (pageNo-1)*rows+1);
		map.put("end", pageNo*rows);
		return usersDao.findByPage(map);
	}
	public List<Users> findByParam(Integer pageNo, Integer rows,Map map) {
		map.put("start", (pageNo-1)*rows+1);
		map.put("end", pageNo*rows);
		return usersDao.findByParam(map);
	}
	public int add(Users users) {
		return usersDao.add(users);
	}
	public int delete(Users users) {
		return usersDao.delete(users);
	}
	public int update(Users users) {
		return usersDao.update(users);
	}
	
	public UsersDao getUsersDao() {
		return usersDao;
	}

	public void setUsersDao(UsersDao usersDao) {
		this.usersDao = usersDao;
	}
	public Users findById(Integer id) {
		return usersDao.findById(id);
	}

}
